const obj = {
  name: "why",
  age: 18,
  friends: {
    name: "kobe"
  },
  hobbies: ["篮球", "足球"],
}

const objStringify = JSON.stringify(obj)
const info = JSON.parse(objStringify)

obj.friends.name = "jinge"
// 弊端,JSON.stringify无法对函数进行处理，对象中存在函数时，无法拷贝函数
console.log(info.friends.name);